package thread;

public class SleepThreadDemo {
    public static void main(String[] args) {

        System.out.println("程序开始运行");
        /*
        - static void sleep(long ms)
            - 使运行该方法的线程进入阻塞状态指定的毫秒,
            超时后线程会自动回到RUNNABLE状态等待再次获取时间片并发运行.
         */
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        System.out.println("程序运行结束");

    }
}
